#pragma once
#include "MemoryMenager.h"
#include <windows.h>

class MemoryMenagerGraphics : public MemoryMenager
{
public:
	typedef enum bstatus {BS_EMPTY,BS_FULL} BlockStatus;
	
	int MemoryPainter;
	char *Actions[200];
	int ActionsCount;

	MemoryMenagerGraphics(char *FileName);
	~MemoryMenagerGraphics(void);

	virtual void Draw(int s,int stage);
	void Initialize();
	void Finalize();

	void DrawBlock(int x1,int y1,int width,int height,
				   int ind,int value,int color,BlockStatus bs);
	
	void DrawMemoryBlock(int ind);
	void DrawPointerBlock(int ind);
	void DrawAction(int ind);
	void DrawFreePointer();
	void DrawScreen();
	void DrawTextInfo();

	SMALL_RECT getMemoryBlockRect(int ind);
	SMALL_RECT getPointerBlockRect(int ind);
	SMALL_RECT getPointerRect();
	SMALL_RECT getActionRect(int ind);

	void AnimateMemoryToPointer(int mindex,int pindex);
	void AnimateMemoryToPointer(int mindex);
	void AnimateMemoryToMemory(int fromindex,int toindex);
	void AnimateActionToAction(int fromindex,int toindex);

	void DrawFileList();

};
